import { Global } from "@nestjs/common";
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity()
export class Visit {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    comment: 'ip地址',
  })
  ip: string;

  @CreateDateColumn({
    comment: '创建时间',
  })
  createDate: Date;

  @Column({
    comment: '用户id',
    nullable: true,
  })
  userId: number;

  @Column({
    comment: '用户名',
    nullable: true,
  })
  username: string;

  @Column({
    comment: '访问url',
    length: 255,
  })
  url: string;

  @Column({
    comment: 'userAgent',
  })
  userAgent: string;

  @Column({
    comment: 'origin',
    nullable: true,
  })
  origin: string;
}
